/**
 * 
 */
package com.peppa.gmf.runtime.diagram.ui.extension.rotatable.figure.listener;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;

import org.eclipse.draw2d.AncestorListener;
import org.eclipse.draw2d.FigureListener;
import org.eclipse.draw2d.IFigure;
import com.peppa.gmf.runtime.diagram.ui.extension.rotatable.editPart.AbstractRotatableImageEditPart;

/**
* @author peppa E-mail: pe_ppa@163.com
* @date 2023年11月22日 下午11:56:01
*/
public class RotatableImageListener implements FigureListener, PropertyChangeListener, AncestorListener {

	AbstractRotatableImageEditPart editpart;

	/**
	 * Constructor
	 * 
	 * @param editPart
	 *            RotatableImageEditPart
	 */
	public RotatableImageListener(AbstractRotatableImageEditPart editpart) {
		this.editpart = editpart;
	}

	/**
	 * Notify the edit part that
	 */
	public void notifyEditPart() {
		editpart.figureHasChanged();
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see org.eclipse.draw2d.FigureListener#figureMoved(org.eclipse.draw2d.IFigure)
	 */
	public void figureMoved(IFigure source) {
		notifyEditPart();
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see java.beans.PropertyChangeListener#propertyChange(org.eclipse.draw2d.IFigure)
	 */
	public void propertyChange(PropertyChangeEvent evt) {
		notifyEditPart();
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see org.eclipse.draw2d.AncestorListener#ancestorAdded(org.eclipse.draw2d.IFigure)
	 */
	public void ancestorAdded(IFigure ancestor) {
		notifyEditPart();
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see org.eclipse.draw2d.AncestorListener#ancestorMoved(org.eclipse.draw2d.IFigure)
	 */
	public void ancestorMoved(IFigure ancestor) {
		notifyEditPart();
	}

	/**
	 * {@inheritDoc}
	 * 
	 * @see org.eclipse.draw2d.AncestorListener#ancestorRemoved(org.eclipse.draw2d.IFigure)
	 */
	public void ancestorRemoved(IFigure ancestor) {
		notifyEditPart();
	}

}
